import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import eslintPlugin from 'vite-plugin-eslint';
import vueJsx from "@vitejs/plugin-vue-jsx";

// https://vitejs.dev/config/
export default defineConfig({
    lintOnsave: false,
    plugins: [
        vue(),
        vueJsx(),
        eslintPlugin({
            include: ['src/**/*.ts', 'src/**/*.vue', 'src/*.ts', 'src/*.vue'],
        }),
    ],
    resolve: {
        // 配置路径别名
        alias: {
            '@': '/src',
            '@c': '/src/components',
            '@v': '/src/views',
            '@u': '/src/utils',
            '@api': '/src/api',
        },
    },
    server: {
        host: '0.0.0.0',
        // port: 8080,      
        open: true,
        proxy: {
            //配置自定义代理规则
            // 字符串简写写法
            '/api': {
                target: 'http://localhost:8080/',
                // target: 'http://quanlinan2023.asia/',
                changeOrigin: true,
            },
            '/group1': {
                target: 'http://quanlinan2023.asia/',
                changeOrigin: true,
            }

        }
    },
}); 
